<?php
/**
 +---------------------------------------<br/>
 * 控制器:订单<br/>
 +---------------------------------------
 * @category membership
 * @package web.front.action
 * @author skygreen skygreen2001@gmail.com
 */
class Action_Coupon extends Action
{
	//订单列表
	public function index(){
		$this->loadCss("resources/css/orderList.css");
        $phone = HttpSession::get("phone");
        $openid = HttpSession::get("openid");
        if(!$openid || !$phone){
        	$openid = isset($_GET['openid']) ? $_GET['openid'] : 0;
        	$member = Member::get_one("weixin='" . $openid . "'");
	        if ($member) {
	            HttpSession::set("cardno", $member->code);
	            HttpSession::set("phone", $member->phone);
	            $coupon = UtilSend::getCoupon($member->phone);
	        	$this->view->set("data",$coupon);
	        } else {
	            $this->redirect("weixin","api");
	        }
        }else{
        	$coupon = UtilSend::getCoupon($phone);
	        $this->view->set("data",$coupon);
        }
        
		
	}

	
}

?>